package com.fl.proyect_softmedic;


import java.util.Calendar;


class CurrentDate{
 
    private int mDay; 
    private String mMonth;
    private int mYear;
    private String dayweek;
    
    private Calendar c = Calendar.getInstance();
    
	
	public String setDate(){
		String[] monthName = {"Enero", "Febrero","Marzo", "Abril", "Mayo", "Junio", "Julio",
	            			  "Agosto", "Septiembre", "Octubre", "Noviembre","Diciembre"};
		
		c = Calendar.getInstance();
		mDay = c.get(Calendar.DAY_OF_MONTH);
		//los meses comienzan desde 0 es decir que enero sera 0, febrero 1, etc
		mMonth = monthName[c.get(Calendar.MONTH)];
		mYear = c.get(Calendar.YEAR);        
		String datecomplete = mDay+"-"+mMonth+"-"+mYear;	
		return datecomplete;	
	}
	
	public String GetDayWeek(int y, int m, int d){   
		String[] DayName = {"Domingo", "Lunes", "Martes","Miercoles", "Jueves", "Viernes", "Sabado"};
		Calendar localCalendar = Calendar.getInstance();
        localCalendar.set(y,m,d);
        int pos = localCalendar.get(Calendar.DAY_OF_WEEK)-1;
        dayweek = DayName[pos];
        return dayweek;
		}
	
}
